butterworth_filter_order Function

public pure function butterworth_filter_order(fp, fs, fstop, apass, astop, ftype) result(n)

Computes the minimum order of a Butterworth low-pass or high-pass filter.

Frequencies are specified in Hz and attenuation values are specified in dB. The frequency prewarping matches design_iir_filter. An order of zero indicates an invalid specification.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: fp

The passband edge frequency, in Hz.

real(kind=real64), intent(in) :: fs

The sampling frequency, in Hz.

real(kind=real64), intent(in) :: fstop

The stopband edge frequency, in Hz.

real(kind=real64), intent(in) :: apass

The maximum passband attenuation, in dB.

real(kind=real64), intent(in) :: astop

The minimum stopband attenuation, in dB.

integer(kind=int32), intent(in), optional :: ftype

LOW_PASS_FILTER (default) or HIGH_PASS_FILTER.

Return Value integer(kind=int32)

The minimum filter order.